#ifndef MINIZINCVARIABLE_H
#define MINIZINCVARIABLE_H

#include "symbolicVariable.h"

#include <string>

using namespace std;

/*
	Class: MiniZincVariable
	Class that represents a variable of MiniZinc.
*/
class MiniZincVariable : public SymbolicVariable
{
	/* Section: public */
	public:
		MiniZincVariable(const string & tableName = "", const string & columnName = "", int rowIndex = 0, ColumnType type = INTEGER , int length = 0);

		MiniZincVariable(const MiniZincVariable & other);

		MiniZincVariable(SymbolicVariable * sv);

		virtual ~MiniZincVariable();

		virtual Expression * clone();

		string toString();
		
		string toOutputString();
};

//to compare two MinizincVariables 
struct set_object {
  bool operator()(MiniZincVariable * first, MiniZincVariable * second) {

    bool r = (first->getTableName().compare(second->getTableName())>0);
    bool r2 = (first->getTableName().compare(second->getTableName())<0);
    bool s = (first->getColumnName().compare(second->getColumnName())>0);
    bool s2 = (first->getColumnName().compare(second->getColumnName())<0);
    bool t = first->getRowIndex()>second->getRowIndex();
    if (r) return true;
    else if (r2) return false;
    else if (s) return true;
    else if (s2) return false;
    else if (t) return true;
    else return false;
  }
};

#endif // MINIZINCVARIABLE_H
